// @flow
import type { $AxiosXHR, $AxiosError } from 'axios';

export const REQUEST = 'request';
export const SUCCESS = 'success';
export const FAILURE = 'failure';

export const SagaTypeCreate = (TYPE: string) => {
  return {
    REQUEST: `${TYPE}`,
    SUCCESS: `${TYPE}/SUCCESS`,
    FAILURE: 'base/SET_ERROR_MESSAGE',
  };
};
export type sagaType<req, scs, err> = {
  type: string,
  payload?: req,
  success?: scs,
  error?: boolean,
  fail?: err,
};
export type ResponseAction = {
  type: string,
  payload: $AxiosXHR<*>,
  error: $AxiosError<*>,
  meta: any,
};
